package shiyan4;

import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;

public class Calculate {
	public static final int x = 200;//优秀200元
	public static final int y = 150;//合格150元
	public static Double taxRate = 0.03;//税率
	public static final int weekCount = 5;//周期
	public static Map<String, List<Student>> roomStudentMap = null;
	
	public static void DistributionRoom(Student student,ClassRoom classRoom) {
	System.out.println("["+classRoom.getRoomName()+"]分配给["+student.getName()+"]");
    String roomId = classRoom.getId();
    if (roomStudentMap == null) {
		roomStudentMap = new HashMap<String, List<Student>>();
		List<Student> studentIdList = new ArrayList<Student>();
		studentIdList.add(student);
		roomStudentMap.put(roomId, studentIdList);
	} else {
		if (roomStudentMap.get(roomId) == null) {
			List<Student> studentIdList = new ArrayList<Student>();
			studentIdList.add(student);
			roomStudentMap.put(roomId, studentIdList);
		} else {
			List<Student> studentIdList = roomStudentMap.get(roomId);
			studentIdList.add(student);
			roomStudentMap.put(roomId, studentIdList);
		}
	}
}

public static void calculateAccout(Student student) {
	int excelentCount = student.getExcellentCount();
	int passCount = student.getPassCount();
	int priceBefore = x * excelentCount + y * passCount;
	System.out.println(student.getName() + "勤工俭学收入" + priceBefore);
	double price = priceBefore - priceBefore * taxRate;
	System.out.println(student.getName() + "税后实际收入" + price);
}

}